<template name="home">
<h1>欢迎:{{username}}</h1>
<div class="container-fluid">
	<div class="row">
		<div class="col-xs-2">
			<a class="btn btn-primary" role="button" data-toggle="collapse" href="#friends" aria-expanded="false" aria-controls="collapseExample" title="点击展开">
  我的好友
      </a>
      <div id="friends" class="panel-collapse collapse" role="tabpanel" aria-labelledby="collapseListGroupHeading1" aria-expanded="false" style="height: 0px;">
        <ul class="list-group">
          {{#if friends}}
          {{#each friends}}
          <li class="list-group-item friends-list" data-id="{{friend.id}}" title="点击和{{friend.username}}聊天">{{friend.username}}</li>
          {{/each}}
          {{else}}
          暂无好友
          
          {{/if}}
        </ul>
      </div>
		</div>
		<div class="col-xs-4">
			<a class="btn btn-primary" role="button" data-toggle="collapse" href="#chatHistory" aria-expanded="false" aria-controls="collapseExample" title="点击展开">历史聊天好友</a>
      <div id="chatHistory" class="panel-collapse collapse" role="tabpanel" aria-labelledby="collapseListGroupHeading1" aria-expanded="false" style="height: 0px;">
        <ul class="list-group">
          {{#if historychatfriends}}
          {{#each historychatfriends}}
          <li class="list-group-item" data-id="{{_id}}">{{username}}</li>
          {{/each}}
          {{else}}
          暂无历史聊天好友
          {{/if}}
        </ul>
      </div>
		</div>
	<div class="col-xs-4">
		<h1>我的群组</h1>
     <ul class="list-group">
          {{#if groups}}
          {{#each groups}}
          <li class="list-group-item">{{groupname}}</li>
          {{/each}}
          {{else}}
          暂无群组
          {{/if}}
        </ul>
	</div>
  <div class="col-xs-2">
      <a class="btn btn-primary" role="button" data-toggle="collapse" href="#operation" aria-expanded="false" aria-controls="collapseExample">操作</a>
      <div id="operation" class="panel-collapse collapse in" role="tabpanel" aria-labelledby="collapseListGroupHeading1" aria-expanded="false" style="height: 0px;">
        <ul class="list-group">
          <li class="list-group-item btn btn-default ops" style="text-align:left" data-op="logout">退出</li>
          <li class="list-group-item btn btn-default ops" style="text-align:left" data-op="password">修改密码</li>
          <li class="list-group-item btn btn-default ops" style="text-align:left" data-op="groups">创建群组</li>
          <li class="list-group-item btn btn-default ops" style="text-align:left" data-op="friends">添加好友</li>
        </ul>
      </div>
    </div>
	</div>
</div>
</template>
<template name="password">
{{>sAlert}}
  <form name="changepassword" id="changepassword" class="form-horizontal">
    <div class="form-group">
      <label for="opassword" class="control-label col-sm-2">原密码</label>
      <div class="col-sm-2">
        <input type="password" name="opassword" id="opassword">
      </div>
    </div>
     <div class="form-group">
      <label for="orepassword" class="control-label col-sm-2">确认原密码</label>
      <div class="col-sm-2">
        <input type="password" name="orepassword" id="orepassword">
      </div>
    </div>
    <div class="form-group">
      <label for="npassword" class="control-label col-sm-2">新密码</label>
      <div class="col-sm-2">
        <input type="password" name="npassword" id="npassword">
      </div>
    </div>
    <div class="form-group">
      <label for="nrepassword" class="control-label col-sm-2">确认密码</label>
      <div class="col-sm-2">
        <input type="password" name="nrepassword" id="nrepassword">
      </div>
    </div>
    <div class="form-group">
      <div class="col-sm-offset-2 col-sm-10">
        <input type="submit" name="subs" id="subs" value="修改密码">
        <input type="button" name="back" id="back" value="返回">
      </div>
    </div>
  </form>
</template>
